<!-- include tpl=head_lay -->
<script type="text/javascript">
function save()
{
	var content = CKEDITOR.instances['content'].getData();
	if(!content){
		$.dialog.alert('回复内容不能为空');
		return false;
	}
	if(content.indexOf('请填写您的回复的信息') > -1){
		$.dialog.alert('请填写回复内容');
		return false;
	}
	var lock = $.dialog.tips('正在发送邮件…',100).lock();
	$("#post_save").ajaxSubmit({
		'url':get_plugin_url('vipext','sendok'),
		'type':'post',
		'dataType':'json',
		'success':function(rs){
			lock.close();
			if(rs.status){
				$.dialog.tips('邮件发送成功',function(){
					$("input[name=email],input[name=fullname],input[name=title]").val('');
				}).lock().time(1.5);
				return true;
			}
			$.dialog.alert(rs.info);
			return false;
		}
	});
	return false;
}
</script>
<form method="post" class="layui-form" id="post_save" onsubmit="return save()">
<div class="layui-card">
	<div class="layui-card-body">
		<div class="layui-form-item">
			<label class="layui-form-label">
				邮件服务器
			</label>
			<div class="layui-input-block">
				<select id="server_id" name="server_id">
				<!-- loop from=$typelist key=$key value=$value id=$tmpid -->
				<option value="{$value.id}">{$value.title}</option>
				<!-- /loop -->
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				姓名
			</label>
			<div class="layui-input-inline default-auto">
				<input type="text" name="fullname" value="{$fullname}" class="layui-input" />
			</div>
			<div class="layui-form-mid">
				请输入收件人姓名
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				<span class="red">*</span> 邮箱
			</label>
			<div class="layui-input-block">
				<input type="text" name="email" value="{$email}" class="layui-input" />
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				<span class="red">*</span> 邮件主题
			</label>
			<div class="layui-input-block">
				<input type="text" name="title" id="title" value="{$title}" class="layui-input" />
			</div>
			<!-- if $wlist -->
			<div class="layui-input-block mtop">
				<!-- loop from=$wlist key=$key value=$value id=$tmpid -->
				<input type="button" value="{$value}" class="layui-btn layui-btn-sm" onclick="$.phpokform.text_button_quickwords('#title','{$value}','none')" />
				<!-- /loop -->
				<input type="button" value="{lang清除}" class="layui-btn layui-btn-sm layui-btn-warm" onclick="$.phpokform.clear('title')" />
			</div>
			<!-- /if -->
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				<span class="red">*</span> 邮件内容
			</label>
			<div class="layui-input-block">
				{$content}
			</div>
		</div>
	</div>
</div>
<div class="submit-info-clear"></div>
<div class="submit-info">
	<div class="layui-container center">
		<input type="submit" value="{lang发送邮件}" class="layui-btn layui-btn-danger" id="save_button" />
		<input type="button" value="{lang关闭}" class="layui-btn layui-btn-primary" onclick="$.admin.close()" />
		<span style="padding-left:2em;color:#ccc;">不会关闭页面，请手动关闭</span>
	</div>
</div>

</form>

<!-- include tpl=foot_lay -->